/* 
 * File:   zxLib.h
 * Author: Administrator
 *
 * Created on 2013?8?13?, ??9:24
 */

#ifndef ZXLIB_H
#define	ZXLIB_H

#ifdef	__cplusplus
extern "C" {
#endif

#ifdef	__cplusplus
}
#endif


#define lowThres 75
#define HighThres 80

#define laserDuringDelay 1
#define laserDuringOdor 2
#define laserDuringBeginningToOneSecInITI 3

#define laserOtherTrial 1
#define laserNoTrial 2
#define laserEveryTrial 3

#define atTrialStart 10
#define atFirstOdorBeginning 20
#define atFirstOdorEnd 30
#define atDelayBegin 40
#define atDelayOneSecIn 50
#define atDelayLastSecIn 60
#define atSecondOdorBeginning 70
#define atSecondOdorEnd 80
#define atRewardDelayBeginning 90
#define atRewardBeginning 100
//#define atRewardBeginning 110
#define atRewardEnd 120
#define atITIBeginning 130
#define atITIOneSecIn 140
#define atITILastSecIn 150
#define atITIEnd 160


extern float odorLength;
void setOdorLength(float in);

void shuffleArray(unsigned int orgArray[], unsigned int arraySize);
void LCDWriteNumber(int n, int digits, int x, int y) ;

void odorDepeltion(int totalTrial);

void zxDNMSSessions(int DNMS, float thisdelay, int interti, int trialNumperSess, float waterlen, float delay2, int missstop, int totalSession);
void zxDNMSLaserSessions(int type, float thisdelay, int interti, int trialNumperSess, float WaterLen, int missstop, int sessstop, float delay_before_reward, float delayBeforeLaser, float laserDuration);
void zxDNMSTrial(int DNMS, int FirstOdorIn, float odorLength, float OdorDelayIn, int SecondOdorIn, float WaterLIn, int IntervalIn, float delay_before_reward);
void zxDNMSLaserTrial(int type, int FirstOdorIn, float odorLength, float OdorDelayIn, int SecondOdorIn, float WaterLIn, int ITI, float delay_before_reward, float delayBeforeLaser, float laserDuration, int laserOnTrial) ;
void zxLaser(int FreqStim, int DuraStim, float totalStimTime);
void setAutoStop(int autoStop_In);
void setAutoSwitch(int autoSwitch_in);
void callFunction(int n);

void zxGoNogoSessions(int odorType, int autoSwitch, int trialn, int delay, float waterlen,
        int ITI, int odorlaseryes, int delaylaseryes);

void zxGoNogoTrial(int go_odor, int isGo, int laserOn, float odorlen, int delay, float waterlen,
        int ITI, int preOdorLaser);
void wait_ms(int time);
void setLaser(void);

void feedWater(int n);
void splash(char * s1, char * s2);

#endif	/* ZXLIB_H */
